﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Wfrm_CrearSolicitud.aspx.vb" Inherits="WebCompras.Wfrm_CrearSolicitud" %>

<%@ Register assembly="Anthem" namespace="Anthem" tagprefix="anthem" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
       <link href="css/default.css" rel="stylesheet" type="text/css" />
<link href="css/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> 

    <link href="css/default.css" rel="stylesheet" type="text/css" />



    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style3
        {
            width: 192px;
        }
        .style4
        {
            width: 77px;
        }
        .style5
        {
            width: 64px;
        }
        .style6
        {
            width: 179px;
        }
        .style7
        {
            width: 450px;
            text-align: left;
        }
        .style8
        {            text-align: left;
        }
        .style9
        {
            width: 125px;
            text-align: left;
        }
        .style10
        {
            height: 21px;
        }
    </style>
    <script type="text/javascript">

        function ValidNum(e) {
            var tecla = document.all ? tecla = e.keyCode : tecla = e.which;
            return ((tecla > 47 && tecla < 58) || tecla == 46);
        }

</script>
    
    
    <script>

$(function () 
{
 
    $('#txtStartDate, #txtEndDate').datepicker(
    {
     closeText: 'Cerrar',
     prevText: '&#x3c;Ant',
     nextText: 'Sig&#x3e;',
     currentText: 'Hoy',
     monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
	'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
    monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
	'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
    dayNames: ['Domingo', 'Lunes', 'Martes', 'Mi&eacute;rcoles', 'Jueves', 'Viernes', 'S&aacute;bado'],
    dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mi&eacute;', 'Juv', 'Vie', 'S&aacute;b'],
    dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'S&aacute;'],
    showOn: "both",
    buttonImage: 'imagenes/calendar.png', //BOTON QUE IRA AL LADO DEL TEXTO
    buttonImageOnly: true,
    weekHeader: 'Sm',
    dateFormat: 'dd/mm/yy',
    firstDay: 1, 
    changeYear: true,
    changeMonth: true,
    yearRange: '-30:+10'   //RANGO DE AÑO
    });
        
});
 
function customRange(input) 
{ 
    var min = new Date(2008, 11 - 1, 1); //Set this to your absolute minimum date
        var dateMin = min;
        var dateMax = null;
        var dayRange = 6;  // Set this to the range of days you want to restrict to
    
        
        if (input.id == "txtStartDate") 
        {
            if ($("#txtEndDate").datepicker("getDate") != null)
            {
                dateMax = $("#txtEndDate").datepicker("getDate");
                dateMin = $("#txtEndDate").datepicker("getDate");
                dateMin.setDate(dateMin.getDate() - dayRange);
                if (dateMin < min)
                {
                        dateMin = min;
                }
             }
             else
             {
                dateMax = new Date(); //Set this to your absolute maximum date
             }                      
        }
        else if (input.id == "txtEndDate")
        {
                dateMax = new Date(); //Set this to your absolute maximum date
                if ($("#txtStartDate").datepicker("getDate") != null) 
                {
                        dateMin = $("#txtStartDate").datepicker("getDate");
//                        var rangeMax = new Date(dateMin.getFullYear(), dateMin.getMonth(), dateMin.getDate() + dayRange);
//                        
                            var rangeMax = new Date("<%= now.year %>", "<%= now.month %>", "<%= now.day %>");
                            var aniofinal = d.getFullYear();
                            var anioinicio = d.getFullYear() - 120;
                            var fechaactual = d.getDate();

                        
                        
                        if(rangeMax < dateMax)
                        {
                            dateMax = rangeMax; 
                        }
                }
        }
    return {
                minDate: dateMin, 
                maxDate: dateMax,
            }; 
 
}
 
</script> 
    
    
<script type="text/javascript">

    function ValidNum(e) {
        var tecla = document.all ? tecla = e.keyCode : tecla = e.which;
        return ((tecla > 47 && tecla < 58) || tecla == 46);
    }

</script>
        
</head>
<body>
    <form id="form1" runat="server">
    
    
    <table class="style1">
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    
    
    <table width="910" border="0" align="center" cellpadding="0" cellspacing="0"> 
	<tr> 
		<td align="center" valign="top" bgcolor="#FFFFFF">
	    <table bgcolor="#e7e3e4"   border="0" cellpadding="0" cellspacing="0" width="600" style="height: 142px" >
        <tr>
                <td>

        <table class="style1">
        <tr >
        <td > 
            <anthem:LinkButton ID="linkSolicitud" runat="server" EnableCallBack="False">Busqueda de Solicitudes</anthem:LinkButton>
            </td> 
        </tr>
        
                                        
                </td>
                
            </tr>
            <tr>
                <td>
                
                    <table class="style1" cellpadding="0" cellspacing="0" style="border-width: 1px">
                        <tr>
                            <td colspan="4" >
                                <anthem:Panel ID="Panel1" Visible ="false" runat="server" BorderStyle="Solid" 
                                    BorderWidth="1px">
                                    <table class="style1">
                                        <tr>
                                            <td class="style4">
                                                <anthem:Label ID="Nsolicitud" Text = "N° Solicitud:" runat="server"></anthem:Label>
                                            </td>
                                            <td class="style3">
                                                <anthem:TextBox ID="txtNsolicitud" runat="server"></anthem:TextBox>
                                            </td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td class="style6">
                                                &nbsp;</td>
                                            <td>
                                                <a href="#" onmouseout="MM_swapImgRestore()" 
                                        onmouseover="MM_swapImage('Aceptar','','../botones/guardar_ov_a.gif',1)">
                                                <anthem:ImageButton ID="buscar" runat="server" 
                                        ImageUrl="~/botones/buscar_up_a.gif" style="height: 22px" />
                                                &nbsp;</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style4">
                                                <anthem:Label Text = "Fecha Desde:" ID="FechaDesde" runat="server"></anthem:Label>
                                            </td>
                                            <td class="style3">
                                                <anthem:TextBox ID="txtStartDate" runat="server"></anthem:TextBox>
                                            </td>
                                            <td class="style5">
                                                <anthem:Label Text = "Fecha Hasta:" ID="FechaHasta" runat="server"></anthem:Label>
                                            </td>
                                            <td class="style6">
                                                <anthem:TextBox ID="txtEndDate" runat="server"></anthem:TextBox>
                                            </td>
                                            <td>
                                                <a href="#" onmouseout="MM_swapImgRestore()" 
                                        onmouseover="MM_swapImage('Aceptar','','../botones/guardar_ov_a.gif',1)">
                                                <anthem:ImageButton ID="Aceptar1" runat="server" 
                                        ImageUrl="~/botones/buscar_up_a.gif" style="height: 22px" 
                                        />
                                                </a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style4">
                                                &nbsp;</td>
                                            <td class="style3">
                                                &nbsp;</td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td class="style6">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td colspan="5">
                                                <anthem:DataGrid ID="DataGrid1" runat="server" AllowCustomPaging="True" AutoGenerateColumns="False" 
                                        BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
                                        CellPadding="5" class="titgrillatd" Font-Bold="False" 
                                    Font-Italic="False" Font-Names="Verdana"
                                        Font-Overline="False" Font-Size="XX-Small" Font-Strikeout="False" Font-Underline="False"
                                        ForeColor="Black" HorizontalAlign="Center" PageSize="7" Width="784px">
                                                    <FooterStyle BackColor="White" BorderColor="#8298B7" BorderStyle="Groove" Font-Bold="False"
                                            Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"
                                            HorizontalAlign="Left" />
                                                    <EditItemStyle BackColor="White" BorderColor="#8298B7" Font-Size="XX-Small" 
                                            HorizontalAlign="Left" />
                                                    <SelectedItemStyle BackColor="White" BorderColor="#8298B7" Font-Bold="True" 
                                            Font-Size="XX-Small" />
                                                    <PagerStyle BackColor="White" BorderColor="#8298B7" Font-Size="XX-Small" />
                                                    <AlternatingItemStyle BackColor="#E6E3E3" BorderColor="#8298B7" BorderStyle="Solid"
                                            BorderWidth="1px" Font-Names="Arial,Helvetica,sans-serif" Font-Size="XX-Small"
                                            HorizontalAlign="Right" />
                                                    <ItemStyle BorderColor="#8298B7" Font-Names="Arial,Helvetica,sans-serif" Font-Size="XX-Small"
                                            ForeColor="#3B3C3C" HorizontalAlign="Right" />
                                                    <HeaderStyle BackColor="#D0DAE6" BorderColor="#8298B7" BorderStyle="Solid" BorderWidth="1px"
                                            Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Size="XX-Small"
                                            Font-Strikeout="False" Font-Underline="False" ForeColor="#054CA2" 
                                            HorizontalAlign="Center" />
                                                    <Columns>
                                                        <asp:TemplateColumn HeaderText="N° Solicitud">
                                                            <ItemTemplate>
                                                                <anthem:LinkButton ID="LinkButton1" runat="server" CommandName="Select" 
                                                        Text='<%# DataBinder.Eval(Container, "DataItem.ID_SOLICITUD") %>'></anthem:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateColumn>
                                                        <asp:BoundColumn DataField="FECHA_CREACION" HeaderText="Fecha">
                                                        </asp:BoundColumn>
                                                        <asp:BoundColumn DataField="DESCRIPCION" HeaderText="Bodega"></asp:BoundColumn>
                                                    </Columns>
                                                </anthem:DataGrid>
                                                <br />
                                            </td>
                                        </tr>
                                    </table>
                                </anthem:Panel>
                            </td>
                        </tr>
                        <tr align="center">
                            <td colspan="4" align="center" >
                                                <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Names="Arial,Helvetica,sans-serif"
                                                    Font-Size="14px" ForeColor="#002D9A" Width="462px" 
                                                    style="text-align: center">Ordenes de Compra Generadas</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="text-align: left">
                                <anthem:Panel ID="pnl_mensaje" runat="server" BackColor="#FFFF99" 
                                    BorderStyle="None" BorderWidth="2px" EnableCallBack="true" Visible="false" 
                                    Width="879px">
                                    <table style="width: 621px">
                                        <tr>
                                            <td>
                                                <anthem:Label ID="lbl_mensaje" text="Ingrese Cantidad" runat="server" CssClass="tomaHorasNormal" 
                                                    ForeColor="#000066">
                                                </anthem:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </anthem:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td class="style9">
                                <anthem:Label ID="lblSolicitud" Text = "N° Solicitud" runat="server"></anthem:Label>
                            </td>
                            <td class="style7">
                                <anthem:TextBox ID="txtSolicitud" runat="server" ReadOnly ="TRUE" Width="60px" ></anthem:TextBox>
                            </td>
                            <td class="style8">
                                <anthem:Label ID="lblBodega" Text = "Bodega Destino" runat="server"></anthem:Label>
                            </td>
                            <td>
                                <anthem:DropDownList ID="cmbBodega" Width = "300px" runat="server">
                                </anthem:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: left">
                                <anthem:Label ID="lblProducto" Text = "Producto" runat="server"></anthem:Label>
                            </td>
                            <td class="style8" colspan="2">
                                <anthem:Label ID="Label4" Text = "Cantidad" runat="server"></anthem:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: left">
                                <anthem:DropDownList ID="cmbProducto" Width = "300px" runat="server">
                                </anthem:DropDownList>
                            </td>
                            <td class="style8">
                                <anthem:TextBox ID="txtCantidad" runat="server" Width="80px"></anthem:TextBox>
                            </td>
                            <td style="text-align: center">
                                    <a href="#" onmouseout="MM_swapImgRestore()" 
                                        
                                    onmouseover="MM_swapImage('Aceptar','','../botones/guardar_ov_a.gif',1)">
                                    <anthem:ImageButton ID="Aceptar2" runat="server" 
                                        ImageUrl="~/botones/Agregar_up_a.gif" style="height: 22px" 
                                        />
                                    </a>
                                </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;</td>
                            <td class="style8">
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="4" style="margin: 1px">
                                <anthem:DataGrid ID="DataGrid2" runat="server" AllowCustomPaging="True" AutoGenerateColumns="False"
                                  BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
                                        CellPadding="5" class="titgrillatd" Font-Bold="False" 
                                    Font-Italic="False" Font-Names="Verdana"
                                        Font-Overline="False" Font-Size="XX-Small" Font-Strikeout="False" Font-Underline="False"
                                        ForeColor="Black" HorizontalAlign="Center" PageSize="7" Width="784px">
                                        <FooterStyle BackColor="White" BorderColor="#8298B7" BorderStyle="Groove" Font-Bold="False"
                                            Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"
                                            HorizontalAlign="Left" />
                                        <EditItemStyle BackColor="White" BorderColor="#8298B7" Font-Size="XX-Small" 
                                            HorizontalAlign="Left" />
                                        <SelectedItemStyle BackColor="White" BorderColor="#8298B7" Font-Bold="True" 
                                            Font-Size="XX-Small" />
                                        <PagerStyle BackColor="White" BorderColor="#8298B7" Font-Size="XX-Small" />
                                        <AlternatingItemStyle BackColor="#E6E3E3" BorderColor="#8298B7" BorderStyle="Solid"
                                            BorderWidth="1px" Font-Names="Arial,Helvetica,sans-serif" Font-Size="XX-Small"
                                            HorizontalAlign="Right" />
                                        <ItemStyle BorderColor="#8298B7" Font-Names="Arial,Helvetica,sans-serif" Font-Size="XX-Small"
                                            ForeColor="#3B3C3C" HorizontalAlign="Right" />
                                        <HeaderStyle BackColor="#D0DAE6" BorderColor="#8298B7" BorderStyle="Solid" BorderWidth="1px"
                                            Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Size="XX-Small"
                                            Font-Strikeout="False" Font-Underline="False" ForeColor="#054CA2" 
                                            HorizontalAlign="Center" />
                                      
                                    <Columns>
                                        <asp:ButtonColumn CommandName="Select" Text="Eliminar"></asp:ButtonColumn>
                                        <asp:BoundColumn HeaderText="nCodigo_PKI" DataField="nCodigo_PKI"></asp:BoundColumn>
                                        <asp:BoundColumn HeaderText="Producto" DataField="tNombre" Visible="False"></asp:BoundColumn>
                                        <asp:BoundColumn HeaderText="tNombre" DataField="tNombre"></asp:BoundColumn>
                                        <asp:BoundColumn HeaderText="Cantidad" DataField="CANT_SOLICITADA"></asp:BoundColumn>
                                    </Columns>
                                   
                                </anthem:DataGrid>
                                <br />
                            </td>
                        </tr>
                    </table>
                </td>
                
            </tr>
            
             </table>
    
        <table class="style1">
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="text-align: right">
                    <anthem:ImageButton ID="ImgNuevaSol" runat="server" />
                </td>
                <td style="text-align: left">
                    <anthem:ImageButton ID="ImgFinSol" runat="server" />
                </td>
                <td style="text-align: right">
                                    <a href="#" onmouseout="MM_swapImgRestore()" 
                                        
                                    onmouseover="MM_swapImage('Aceptar','','../botones/guardar_ov_a.gif',1)">
                                    <anthem:ImageButton ID="Aceptar3" runat="server" 
                                        ImageUrl="~/botones/guardar_up_a.gif" style="height: 22px" 
                                        />
                                    </a>
                </td>
            </tr>
        </table>
    
   
    
                   </td>
        </tr>
    
    </table>
		</td> 
	</tr> 
</table> 

    </form>
</body>
</html>

